package com.bw.usercenter.repositoty

import com.bw.net.protocol.resp.BaseRespEntity
import com.bw.usercenter.contract.UserCenterContract
import com.bw.usercenter.model.protocol.req.UserEntitiy
import com.bw.usercenter.model.protocol.resp.*
import com.bw.usercenter.model.service.UserCenterModelImpl
import io.reactivex.Observable
import io.reactivex.Observer

/**
 * 继承契约类---UserCenterRepository
 */
class UserCenterRepositoryImpl: UserCenterContract.UserCenterRepository() {
    override fun register(enity: UserEntitiy): Observable<BaseRespEntity<RespUserEntity>> {
        return mModel.register(enity)
    }

    override fun login(enity: UserEntitiy): Observable<BaseRespEntity<RespUserEntity>> {
        return mModel.login(enity)
    }

    override fun requestTB(page: Int): Observable<RespGoodEntity> {
        return mModel.requestTB(page)
    }

    override fun getRecomment(): Observable<RespRecommendEntity> {
        return mModel.getRecomment()
    }

    override fun getauthcode(): Observable<Int> {
        return mModel.getauthcode()
    }

    override fun getSrarch(name: String): Observable<RespSearchEntity> {
        return mModel.getSrarch(name)
    }

    override fun getSearchitem(string: String): Observable<RespSearchitemIDEntity> {
        return mModel.getSearchitem(string)
    }

    override fun createModel(): UserCenterContract.UserContractModel {
        return UserCenterModelImpl()
    }
}